# -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python

class Recipe(recipe.Recipe):
    name = 'librsvg'
    version = '2.40.16'
    licenses = [License.LGPLv2]
    deps = ['libcroco', 'gdk-pixbuf', 'vala-m4', 'gobject-introspection-m4', 'pango', 'cairo']
    autoreconf = True
    autoreconf_sh = 'mkdir -p m4 && autoreconf -fiv'
    stype = SourceType.TARBALL
    url = 'http://ftp.acc.umu.se/pub/GNOME/sources/librsvg/2.40/librsvg-%(version)s.tar.xz'

    files_libs = ['librsvg-2']
    files_bins = ['rsvg-convert']
    files_loader = []
    files_devel = ['include/librsvg-2.0/librsvg/*.h',
                   'lib/pkgconfig/librsvg-2.0.pc',
                   'lib/librsvg-2.a', 'lib/librsvg-2.la']
    files_typelibs = ['Rsvg-2.0']
    # GTK3 support just builds rsvg-view-3, which is useless for Cerbero
    configure_options = ' --disable-pixbuf-loader --without-gtk3 '

    patches = ['librsvg/option-enable-disable-gtk.patch',
               'librsvg/0001-Use-ACLOCAL_FLAGS.patch'
    ]

    def prepare(self):
        if self.config.target_platform in [Platform.DARWIN, Platform.IOS]:
            self.configure_options += ' --disable-Bsymbolic'
